package com.example.tkmybatisspringboot.controller;

import com.example.tkmybatisspringboot.pojo.Student;
import com.example.tkmybatisspringboot.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/student")
public class StudentController {
    @Autowired
    private StudentService studentService;
    @PostMapping("/add")
    public String addStudent(String aa){
        Student student = new Student();
        student.setName("Ikun");
        student.setAddress("两年半");
        student.setScore("18");
        studentService.add(student);
        return "Ikun成功!!!";
    }
}
